# !pip install --quiet geopandas hvplot geoviews dataretrievalWorking with time-series from the USGS
Working with time-series from the USGS
In this notebook we’ll walk you through how to access data from the USGS Water Data initiative. We’ll look at a USGS stream gage that monitors flows on the White River located near Oglala, SD.
Read more about this USGS stream gage here: https://waterdata.usgs.gov/monitoring-location/USGS-06446000/
from landmapy.usgs import get_usgs_data, find_usgs_site, get_site_metadata
# Find the site information dynamically
sites = find_usgs_site("White River near Oglala", "SD")
if not sites.empty:
site_info = sites.iloc[0]
site_id = site_info['site_no']
# Get available parameters and period of record
meta = get_site_metadata(site_id)
df_daily = get_usgs_data(
site_id=site_id,
site_name=site_info['station_nm'],
latitude=site_info['dec_lat_va'],
longitude=site_info['dec_long_va'],
parameters=meta['parameters'],
start_date=meta['start_date'],
end_date=meta['end_date'],
plot_map=True,
plot_series=True
)
print(df_daily.head())
else:
print("Site not found.")/users/brianyandell/miniconda3/envs/earth-analytics-python/lib/python3.11/site-packages/dataretrieval/nwis.py:692: UserWarning: WARNING: Starting in March 2024, the NWIS qw data endpoint is retiring and no longer receives updates. For more information, refer to https://waterdata.usgs.gov.nwis/qwdata and https://doi-usgs.github.io/dataRetrieval/articles/Status.html or email CompTools@usgs.gov.
warnings.warn(
/users/brianyandell/miniconda3/envs/earth-analytics-python/lib/python3.11/site-packages/dask/dataframe/__init__.py:49: FutureWarning:
Dask dataframe query planning is disabled because dask-expr is not installed.
You can install it with `pip install dask[dataframe]` or `conda install dask`.
This will raise in a future version.
warnings.warn(msg, FutureWarning)